/**
 * 
 */
package org.xlab.baseframework.web.images;

import java.io.InputStream;

import org.xlab.baseframework.system.PlatformDeclare;

import com.vaadin.terminal.StreamResource.StreamSource;

/**
 * @author MaKuBEX
 * 
 */
public enum IconStreamSource implements StreamSource {

	ICON_ACCEPT(PlatformDeclare.IMAGE_DIR_PATH + "/accept.png"), ICON_ADD_TO_SHOPPING_CART(
			PlatformDeclare.IMAGE_DIR_PATH + "/add_to_shopping_cart.png"), ICON_ADD(
			PlatformDeclare.IMAGE_DIR_PATH + "/add.png"), ICON_ATTACHMENT(
			PlatformDeclare.IMAGE_DIR_PATH + "/attachment.png"), ICON_BACK(
			PlatformDeclare.IMAGE_DIR_PATH + "/back.png"), ICON_BOX(
			PlatformDeclare.IMAGE_DIR_PATH + "/box.png"), ICON_CALCULATOR(
			PlatformDeclare.IMAGE_DIR_PATH + "/calculator.png"), ICON_CALENDAR(
			PlatformDeclare.IMAGE_DIR_PATH + "/calendar.png"), ICON_CAMERA(
			PlatformDeclare.IMAGE_DIR_PATH + "/camera.png"), ICON_CHART_DOWN(
			PlatformDeclare.IMAGE_DIR_PATH + "/chart_down.png"), ICON_CHART_UP(
			PlatformDeclare.IMAGE_DIR_PATH + "/chart_up.png"), ICON_CHART(
			PlatformDeclare.IMAGE_DIR_PATH + "/chart.png"), ICON_CHESS(
			PlatformDeclare.IMAGE_DIR_PATH + "/chess.png"), ICON_CLOUD_COMMENT(
			PlatformDeclare.IMAGE_DIR_PATH + "/cloud_comment.png");

	private String path;

	private IconStreamSource(String path) {
		this.path = path;
	}

	/**
	 * @see com.vaadin.terminal.StreamResource.StreamSource#getStream()
	 */
	@Override
	public InputStream getStream() {
		return this.getClass().getClassLoader().getResourceAsStream(this.path);
	}

}
